class IndexModel {
  int errno;
  Data data;
  String errmsg;

  IndexModel({this.errno, this.data, this.errmsg});

  IndexModel.fromJson(Map<String, dynamic> json) {
    errno = json['errno'];
    data = json['data'] != null ? new Data.fromJson(json['data']) : null;
    errmsg = json['errmsg'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['errno'] = this.errno;
    if (this.data != null) {
      data['data'] = this.data.toJson();
    }
    data['errmsg'] = this.errmsg;
    return data;
  }
}

class Data {
  List<Channel> channel;
  List<FloorGoodsList> floorGoodsList;

  Data({this.channel, this.floorGoodsList});

  Data.fromJson(Map<String, dynamic> json) {
    if (json['channel'] != null) {
      channel = new List<Channel>();
      json['channel'].forEach((v) {
        channel.add(new Channel.fromJson(v));
      });
    }
    if (json['floorGoodsList'] != null) {
      floorGoodsList = new List<FloorGoodsList>();
      json['floorGoodsList'].forEach((v) {
        floorGoodsList.add(new FloorGoodsList.fromJson(v));
      });
    }
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    if (this.channel != null) {
      data['channel'] = this.channel.map((v) => v.toJson()).toList();
    }
    if (this.floorGoodsList != null) {
      data['floorGoodsList'] =
          this.floorGoodsList.map((v) => v.toJson()).toList();
    }
    return data;
  }
}

class Channel {
  int id;
  String name;
  String iconUrl;
  List<Category> category;

  Channel({this.id, this.name, this.iconUrl, this.category});

  Channel.fromJson(Map<String, dynamic> json) {
    id = json['id'];
    name = json['name'];
    iconUrl = json['iconUrl'];
    if (json['category'] != null) {
      category = new List<Category>();
      json['category'].forEach((v) {
        category.add(new Category.fromJson(v));
      });
    }
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['id'] = this.id;
    data['name'] = this.name;
    data['iconUrl'] = this.iconUrl;
    if (this.category != null) {
      data['category'] = this.category.map((v) => v.toJson()).toList();
    }
    return data;
  }
}

class Category {
  int id;
  String name;
  String keywords;
  String desc;
  int pid;
  String iconUrl;
  String picUrl;
  String level;
  int sortOrder;
  String addTime;
  String updateTime;
  bool deleted;

  Category(
      {this.id,
      this.name,
      this.keywords,
      this.desc,
      this.pid,
      this.iconUrl,
      this.picUrl,
      this.level,
      this.sortOrder,
      this.addTime,
      this.updateTime,
      this.deleted});

  Category.fromJson(Map<String, dynamic> json) {
    id = json['id'];
    name = json['name'];
    keywords = json['keywords'];
    desc = json['desc'];
    pid = json['pid'];
    iconUrl = json['iconUrl'];
    picUrl = json['picUrl'];
    level = json['level'];
    sortOrder = json['sortOrder'];
    addTime = json['addTime'];
    updateTime = json['updateTime'];
    deleted = json['deleted'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['id'] = this.id;
    data['name'] = this.name;
    data['keywords'] = this.keywords;
    data['desc'] = this.desc;
    data['pid'] = this.pid;
    data['iconUrl'] = this.iconUrl;
    data['picUrl'] = this.picUrl;
    data['level'] = this.level;
    data['sortOrder'] = this.sortOrder;
    data['addTime'] = this.addTime;
    data['updateTime'] = this.updateTime;
    data['deleted'] = this.deleted;
    return data;
  }
}

class FloorGoodsList {
  String name;
  List<GoodsList> goodsList;
  int id;

  FloorGoodsList({this.name, this.goodsList, this.id});

  FloorGoodsList.fromJson(Map<String, dynamic> json) {
    name = json['name'];
    if (json['goodsList'] != null) {
      goodsList = new List<GoodsList>();
      json['goodsList'].forEach((v) {
        goodsList.add(new GoodsList.fromJson(v));
      });
    }
    id = json['id'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['name'] = this.name;
    if (this.goodsList != null) {
      data['goodsList'] = this.goodsList.map((v) => v.toJson()).toList();
    }
    data['id'] = this.id;
    return data;
  }
}

class GoodsList {
  int id;
  String name;
  String brief;
  String picUrl;
  bool isNew;
  bool isHot;
  double counterPrice;
  double retailPrice;

  GoodsList(
      {this.id,
      this.name,
      this.brief,
      this.picUrl,
      this.isNew,
      this.isHot,
      this.counterPrice,
      this.retailPrice});

  GoodsList.fromJson(Map<String, dynamic> json) {
    id = json['id'];
    name = json['name'];
    brief = json['brief'];
    picUrl = json['picUrl'];
    isNew = json['isNew'];
    isHot = json['isHot'];
    counterPrice = json['counterPrice'];
    retailPrice = json['retailPrice'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['id'] = this.id;
    data['name'] = this.name;
    data['brief'] = this.brief;
    data['picUrl'] = this.picUrl;
    data['isNew'] = this.isNew;
    data['isHot'] = this.isHot;
    data['counterPrice'] = this.counterPrice;
    data['retailPrice'] = this.retailPrice;
    return data;
  }
}